﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListDefaultParams.ascx.cs" Inherits="Shop.Web.Controls.Ajax.ListDefaultParams" %>
var TODAY = new Date();
var DATE_STARTUP_CHANGE = false;
var IS_EXPORT = "False";
var IS_FIRST_LOAD = true;

if (typeof(DEF_TAB) == 'undefined'){
	var DEF_TAB = "2";
}

if (typeof(DEF_SORT_COL) == 'undefined'){
    var DEF_SORT_COL = "CreateDate";
}

if (typeof(DEF_SORT_DIR) == 'undefined'){
    var DEF_SORT_DIR = "True";
}

var DEF_PAGE = "1";
var DEF_ROWS = "20";
var DEF_START_DATE =  new Date();
DEF_START_DATE.setDate(TODAY.getDate() - 7);
var DEF_END_DATE =  new Date();
var DEF_KEYWORD = "";
var DEF_DELIVERY = "False";
 
var CUR_TAB = <%= String.IsNullOrEmpty(tab) ? "DEF_TAB" : "'" + tab + "'" %>;
var CUR_SORT_COL = <%= String.IsNullOrEmpty(Request.QueryString["sort"]) ? "DEF_SORT_COL" : "'" + Request.QueryString["sort"] + "'" %>;
var CUR_SORT_DIR = <%= String.IsNullOrEmpty(Request.QueryString["desc"]) ? "DEF_SORT_DIR" : "'" + Request.QueryString["desc"] + "'"%>;
var CUR_PAGE = <%= String.IsNullOrEmpty(Request.QueryString["page"]) ? "DEF_PAGE" : "'" + Request.QueryString["page"] + "'"%>;
var CUR_ROWS = <%= String.IsNullOrEmpty(Request.QueryString["rows"]) ? "DEF_ROWS" : "'" + Request.QueryString["rows"] + "'"%>;
var CUR_START_DATE = <%= String.IsNullOrEmpty(Request.QueryString["creationDateFrom"]) ? "DEF_START_DATE" : "String2Date('" + Request.QueryString["creationDateFrom"] + "')"%>;
var CUR_END_DATE = <%= String.IsNullOrEmpty(Request.QueryString["creationDateTo"]) ? "DEF_END_DATE" : "String2Date('" + Request.QueryString["creationDateTo"] + "')"%>;
var CUR_KEYWORD = <%= String.IsNullOrEmpty(Request.QueryString["keyword"]) ? "DEF_KEYWORD" : "'" + Request.QueryString["keyword"] + "'"%>;
var CUR_DELIVERY = <%= String.IsNullOrEmpty(Request.QueryString["delivery"]) ? "DEF_DELIVERY" : "'" + Request.QueryString["delivery"] + "'"%>;
<% if (!String.IsNullOrEmpty(Request.QueryString["creationDateFrom"]) && !String.IsNullOrEmpty(Request.QueryString["creationDateTo"])) { %>
DATE_STARTUP_CHANGE = true;
<% } %>